#include <bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f^=(ch=='-'),ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return f?x:-x;
}
const int N=505,P=1e9+7;
int f[N][N][5],n,k,cho[N],now,last;
int check1(int l,int r){
	if(cho[l]==1&&cho[r]==2)return 1;
	if(cho[l]==1&&cho[r]==4)return 1;
	if(cho[l]==4){
		if(cho[r]==2)return 1;
		if(cho[r]==4)return 1;
	}
	return 0;
}
char str[N];
int dfs(int l,int r,int idx){
	if(l>r)return 0;
	if(l==r&&idx==1)return 0;
	if(l==r&&(idx==3||idx==4))return 0;
	if(f[l][r][idx]!=-1)return f[l][r][idx];
	if(idx==2&&r-l+1>k){
		return f[l][r][idx]=0;
	}
	if(idx==1){
		int sum=0;
		if(check1(l,r)){
			sum=(sum+dfs(l+1,r-1,1))%P;
			sum=(sum+dfs(l+1,r-1,2))%P;
			sum=(sum+dfs(l+1,r-1,3))%P;
			sum=(sum+dfs(l+1,r-1,4))%P;
		}
		for(int i=l;i<r;i++){
			sum=(sum+dfs(l,i,3)*dfs(i+1,r,1)%P)%P;
		}
		for(int i=l;i<r;i++){
			sum=(sum+dfs(l,i,1)*dfs(i+1,r,1)%P)%P;
		}
		return f[l][r][idx]=sum;
	}
	if(idx==2){
		int sum=0;
		if((cho[l]==3||cho[l]==4)&&dfs(l+1,r,2))sum=1;
		return f[l][r][idx]=sum;
	}
	if(idx==3){
		int sum=0;
		for(int i=l;i<r;i++){
			sum=(sum+dfs(l,i,1)*dfs(i+1,r,2)%P)%P;
		}
		return f[l][r][idx]=sum;
	}
	if(idx==4){
		int sum=0;
		for(int i=l;i<r;i++){
			sum=(sum+dfs(l,i,2)*dfs(i+1,r,1)%P)%P;
		}
		return f[l][r][idx]=sum;
	}
}
signed main(){
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	n=read(),k=read();
	scanf("%s",str+1);
	for(int i=1;i<=n;i++){
		if(str[i]=='(')cho[i]=1;
		if(str[i]==')')cho[i]=2;
		if(str[i]=='*')cho[i]=3;
		if(str[i]=='?')cho[i]=4;
	}
	memset(f,-1,sizeof(f));
	for(int i=1;i<n;i++){
		if(cho[i]==1&&cho[i+1]==2)f[i][i+1][1]=1;
		if(cho[i]==4&&cho[i+1]==2)f[i][i+1][1]=1;
		if(cho[i]==1&&cho[i+1]==4)f[i][i+1][1]=1;
		if(cho[i]==4&&cho[i+1]==4)f[i][i+1][1]=1;
		if(cho[i]==3||cho[i]==4)f[i][i][2]=1;
	}
	dfs(1,n,1);
	
	printf("%lld",dfs(1,n,1));
}
